<!DOCTYPE html>
<html lang="en">

<head>
  <meta charset="UTF-8">
  <meta http-equiv="X-UA-Compatible" content="IE=edge">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>Document</title>
</head>

<body>
  <script src="https://cdn.bootcdn.net/ajax/libs/axios/1.3.6/axios.js"></script>

  <script>
    /* 方法1： */
    axios({
      url: 'http://hmajax.itheima.net/api/city',
      params: {
        /* 键[字段]:后端定义的不能随意写  值：前端传递的 */
        pname: '广东省' //预备
      }
    }).then(res => {
      console.log(res, 44);
    })

    /* 方法2： */
    // axios({
    //   url: 'http://hmajax.itheima.net/api/city?pname=广东省'
    // }).then(res => {
    //   console.log(res, 44);
    // })
  </script>
</body>

</html>